//
//  KEWordsModel.swift
//  KoalaEn
//
//  Created by Wade on 2024/9/23.
//

import Foundation
struct KELetterResult:Decodable{
       var result:Array<KELetterDetail>?
      var error:String?
}

struct KELetterDetail:Decodable{
       var letter:String?
      var _id:String?
}


/*
 {"_id":"66eecd41f08210ababa8d5f9","word_level":0,"word_en":"apple","word_zh":"苹果","word_sentences":[{"word_sentences_en":"I have an apple.","word_sentences_zh":"我有一个苹果。"}],"letter_id":[{"_id":"66ed2697ee97ef02f0fc840b","letter":"A"}],"word_category_id":[{"_id":"66eec3ea816a3ffb2dc23175","word_category_en":"fruit","word_category_zh":"水果"},"word_iamges":["https://mp-d6f030db-0e27-458b-906b-ae7d21ab9004.cdn.bspapp.com/cloudstorage/f1de0130-8a44-4d71-a119-d27689e71edf.png"]},
 */

struct KEWordResult:Decodable{
       var result:Array<KEWordsDetail>?
       var error:String?
}

struct KEWordsDetail:Decodable,Hashable{
    static func == (lhs: KEWordsDetail, rhs: KEWordsDetail) -> Bool {
        return lhs.word_en == rhs.word_en &&  lhs.word_zh == rhs.word_zh
    }
    
    func hash(into hasher: inout Hasher) {
          hasher.combine(word_zh)
          hasher.combine(word_en)
          hasher.combine(word_level)
          hasher.combine(word_sort)
      }
    
    var _id:String?
    var word_zh:String?
    var word_en:String?
    var word_iamges:Array<String>?
//    var word_category_id:Array<KEWordsCategoryDetail>?
    var word_category_id:String?
    var word_sentences:Array<KEWordsSentencesDetail>?
   
    var word_level:Int?
    var word_sort:Int?
}
struct KEWordsCategoryDetail:Decodable{
    var _id:String?
    var word_category_en:String?
    var word_category_zh:String?
}
struct KEWordsSentencesDetail:Decodable{
    var _id:String?
    var word_sentences_en:String?
    var word_sentences_zh:String?
}


